﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;

namespace FileCopy.Common
{
    public static class File
    {
        public static int GetHash(string filePath)
        {
            using (HashAlgorithm hashAlg = new SHA1Managed())
            {
                using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
                {
                    byte[] hash = hashAlg.ComputeHash(fileStream);
                    return BitConverter.ToInt32(hash, 0);
                }
            }
        }
    }
}
